'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class step extends Model {
    static associate(models) {
      // define association here
    }
  };
  step.init({
    id: {
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER,
      comment: 'id'
    },
    cookbook_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: 'id'
    },
    pic: {
      type: Sequelize.STRING(50),
      allowNull: false,
      defaultValue: '',
      comment: '步骤图'
    },
    description: {
      type: Sequelize.STRING(200),
      allowNull: false,
      defaultValue: '',
      comment: '描述'
    },
    created_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'created_at',
      comment: '创建评论的时间'
    },
    updated_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'updated_at',
      comment: '更新评论的时间'
    }
  }, {
    sequelize,
    modelName: 'step',
    tableName: 'step'
  });
  return step;
};